// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   XMLFilter.java

package presenter;

import java.io.File;
import javax.swing.filechooser.FileFilter;

public class XMLFilter extends FileFilter
{

    public XMLFilter()
    {
    }

    public String getDescription()
    {
        return "XML files";
    }

    public boolean accept(File f)
    {
        String extension = getExtension(f);
        return extension != null && (extension.equals("xml") || extension.equals("XML")) || f.isDirectory();
    }

    public static String getExtension(File f)
    {
        String ext = null;
        String s = f.getName();
        int i = s.lastIndexOf('.');
        if(i > 0 && i < s.length() - 1)
            ext = s.substring(i + 1).toLowerCase();
        return ext;
    }
}
